package com.wyk.controller;

import cn.hutool.core.lang.UUID;
import com.wyk.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author WangYuKai
 * @Date 2022/6/21
 * @apiNote
 */
@RestController
@Slf4j
public class OrderController {
    //注入访问模板
    @Resource
    private RestTemplate restTemplate;

    //注入服务器名称
    private static final String serverUrl = "http://cloud-provider-payment8004";

    //访问服务端
    @GetMapping("/consumer/payment/zk")
    public Result consumerZk() {
        String forObject = restTemplate.getForObject(serverUrl + "/payment/zk", String.class);
        return new Result(200, "消费者访问成功", forObject);
    }

}
